<html>
    <head>
        <title>Unit test results</title>
        <style type="text/css">
            body{
                background-color: black;
                color:white;
                font-family: monospace;
                margin:10px;
            }
            table{                
                width: 100%;
                color:white;
                margin-bottom: 16px;                
            }
            h1{
                color: orange;
                text-decoration: underline;
            }
            .result{
                font-size: 16px;
            }

            .pass{
                color: white;
                font-weight: bold;
                font-size: 15px;
                background: green;
                text-align: right;
                padding-top: 10px;
                padding-bottom: 10px;
                padding-right:  5px;
                -moz-border-radius: 3px 3px 3px 3px;
            }
            .fail{
                background: red;
                font-weight: bold;
                font-size: 15px;
                color: white;
                text-align: right;
                padding-top: 10px;
                padding-bottom: 10px;
                padding-right: 5px;
                -moz-border-radius: 3px 3px 3px 3px;
                
            }
            a{
                font-size:  15px;
                color:lightgreen;
                text-decoration: none;
            }
            a:hover{
                font-weight: bold;
                text-decoration: underline;
            }
            a:visited{
                color:lightgreen;
            }
            .details{
             background-color:    #1F1F1E;
             -moz-border-radius: 3px 3px 3px 3px;
             padding: 10px;
            }
}
        </style>
    </head>
    <body>
        <center>
            <h2 style="color: green">NGBD-cart Unit Tests:</h2>
        
    
        <select onchange="document.location = this.options[this.selectedIndex].value" style="padding: 5px;width: 250px;margin-bottom: 10px;border:1px solid #343333;background-color: #343333;color:white">
            <option>Select a test..</option>
        <?php
            $modules = Module_Extended::list_active_modules();
            foreach($modules as $m){
                  $name = $m->name;
                  $files = glob(APPPATH."modules/$name/controllers/tests/*.php");
                  if(count($files)){
                      echo "<optgroup label='$name'>";
                      foreach (glob(APPPATH."modules/$name/controllers/tests/*.php") as $filename){
                          $path =  explode(".",basename($filename));
                          $url =  base_url()."index.php/$name/tests/".$path[0];
                         echo "<option value='$url' >". basename($filename)."</option>" ;
                      }
                      echo "</optgroup >";
                  }
            }
           
        ?>
 </select>
            </center>
        <br>        
